package com.hcbd.tdwt.util;


import com.hcbd.tdwt.ui.xingyu.vo.BoxContact;

import java.util.Comparator;

/**
 * - @Description:  拼音比较工具
 * - @Author:  LXJ
 * - @Time:  2018/12/5 16:09
 */

public class PinyinComparator implements Comparator<BoxContact> {

    @Override
    public int compare(BoxContact o1, BoxContact o2) {
        if (o1.getSortLetter().equals("@")
                || o2.getSortLetter().equals("#")) {
            return -1;
        } else if (o1.getSortLetter().equals("#")
                || o2.getSortLetter().equals("@")) {
            return 1;
        } else {
            return o1.getSortLetter().compareTo(o2.getSortLetter());
        }
    }
}